import axios from 'axios';
import React, { useEffect, useState } from 'react'

export default function App() {
  const [list, setlist] = useState([]);
  useEffect(()=>{    //hooks写法里在useEffects中进行数据请求
    axios({
        url:'/api/mmdb/movie/v3/list/hot.json?ct=%E5%B9%BF%E5%B7%9E&ci=20&channelId=4'
    }).then(res =>{
        console.log(res.data.data.hot)
        setlist(res.data.data.hot);
    })
  },[])
  return (
    <div>
        {
            list.map(item => 
                <div key={item.videoId}>
                    {item.nm}
                </div>)
        }
    </div>
  )
}
